package cn.zwx.canal.tools.enums;

import lombok.val;

/**
 * @description:
 * @projectName:learn
 * @see:cn.zwx.canal.tools.enums
 * @author:zhangwenxue
 * @createTime:2020/12/19 14:58
 * @version:1.0
 */
public enum  BuisType {

    INSERT(1,"新增"),
    UPDATE(2,"修改"),
    DELETE(3,"删除");

    private Integer code;

    private String msg;

    BuisType(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
    
    public static String ofValue(Integer code){
        BuisType[] values = BuisType.values();
        for (BuisType value : values) {
            if (value.code.equals(code)){
                return value.msg;
            }
        }
        return "";
    }
}
